home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD School House 10
/
CD School House - Education and Games (10.0) - Wayzata Technology (1995).iso
/
mac
/
DOS
/
MATH
/
ODE25
/
DUFFING.ODE
< prev
next >
Wrap
Text File
|
1994-03-03
|
378b
|
22 lines
# DUFFING.ODE
# Duffing oscillator
# A driven nonlinear oscillator with chaotic solutions.
# Try plotting v against x.
# Use 5th order Runge-Kutta, fixed step size, 100 steps
$m -5
$n 200
$g d
# Solve to 100
$t 200
x = 1
v = 0
t = 0
a = 0.3 # a is drive amplitude
twopi = pi(2)
x' = v/twopi
v' = (-cub(x) + x - 0.25*v + a*cos(t))/twopi
t' = 1